home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / mklfs / RCS / getMachineInfo.c,v < prev    next >
Encoding:
Text File  |  1991-05-31  |  2.4 KB  |  103 lines

  1. head     1.1;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.1
  10. date     91.05.31.11.09.31;  author mendel;  state Exp;
  11. branches ;
  12. next     ;
  13.  
  14.  
  15. desc
  16. @Subroutine to return machine attributes needed to make a lfs file system.
  17. @
  18.  
  19.  
  20.  
  21. 1.1
  22. log
  23. @Initial revision
  24. @
  25. text
  26. @/* 
  27.  * getMachineInfo.c --
  28.  *
  29.  *    Routine to get infomation needed for LFS file systems from a
  30.  *    machine.
  31.  *
  32.  * Copyright 1991 Regents of the University of California
  33.  * Permission to use, copy, modify, and distribute this
  34.  * software and its documentation for any purpose and without
  35.  * fee is hereby granted, provided that this copyright
  36.  * notice appears in all copies.  The University of California
  37.  * makes no representations about the suitability of this
  38.  * software for any purpose.  It is provided "as is" without
  39.  * express or implied warranty.
  40.  */
  41.  
  42. #ifndef lint
  43. static char rcsid[] = "$Header: /sprite/lib/forms/RCS/proto.c,v 1.5 91/02/09 13:24:44 ouster Exp $ SPRITE (Berkeley)";
  44. #endif /* not lint */
  45.  
  46. #ifdef __STDC__
  47. /*
  48.  * If we are compiling on a machine that has a ASCII C compiler, set the
  49.  * define _HAS_PROTOTYPES which causes the Sprite header files to 
  50.  * expand function definitions to included prototypes.
  51.  */
  52. #define    _HAS_PROTOTYPES 
  53. #endif /* __STDC__ */
  54.  
  55. #include <sprite.h>
  56. #include <varargs.h>
  57. #include <stdio.h>
  58. #include <cfuncproto.h>
  59. #include <stdlib.h>
  60. #include "getMachineInfo.h"
  61.  
  62. #include <kernel/fs.h>
  63. #include <kernel/fsStat.h>
  64. #include <fsCmd.h>
  65.  
  66.  
  67. /*
  68.  *----------------------------------------------------------------------
  69.  *
  70.  * GetMachineInfo --
  71.  *
  72.  *    Routine to get infomation needed for LFS file systems from a
  73.  *    machine.
  74.  *
  75.  * Results:
  76.  *    None.
  77.  *
  78.  * Side effects:
  79.  *    None.
  80.  *
  81.  *----------------------------------------------------------------------
  82.  */
  83.  
  84. void
  85. GetMachineInfo(serverIDPtr, maxNumCacheBlocksPtr)
  86.     int    *serverIDPtr;    /* OUT: Server ID of machine. */
  87.     int    *maxNumCacheBlocksPtr; /* OUT: Maximum number of cache blocks. */
  88. {
  89.     Fs_Stats fsStats;
  90.     ReturnStatus status;
  91.     extern ReturnStatus Proc_GetHostIDs 
  92.             _ARGS_((int *virtualHostPtr, int *physicalHostPtr));
  93.     (void)Proc_GetHostIDs(serverIDPtr, (int *) NULL);
  94.     status = Fs_Command(FS_RETURN_STATS, sizeof(Fs_Stats), (char *)&fsStats);
  95.     if (status != SUCCESS) {
  96.     Stat_PrintMsg(status, "Fs_Command failed");
  97.     exit(status);
  98.     }
  99.     *maxNumCacheBlocksPtr = fsStats.blockCache.maxNumBlocks;
  100. }
  101.  
  102. @
  103.